package rip.protocol;

import java.util.List;
import java.util.Vector;

public class Network {
	private String address = null;
	private List<Message> messages = null;

	public Network() {
		this(null, null);
	}

	public Network(String address, List<Message> messages) {
		this.address = address;
		this.messages = messages;
	}
	
	public void addMessage(Message mes){
		if (messages == null){
			messages = new Vector<Message>();
		}
		messages.add(mes);
	}
	
	@Override
	public boolean equals(Object obj) {
		return this.address.equals(((Network)obj).getAddress());
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public List<Message> getMessages() {
		return messages;
	}

	public void setMessages(List<Message> messages) {
		this.messages = messages;
	}
}
